import Vue from 'vue'
import VueRouter from 'vue-router'
import { routes } from './routes'
import routerMiddleware from '@/middleware/router'

Vue.use(VueRouter)

const router = new VueRouter({
    mode: 'history',
    routes
})

router.beforeEach((to, from, next) => {
    routerMiddleware.beforeEach({to, from, next})
})
export default router

